﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DevExpress.Web.ASPxGridView;

public partial class Teacher_Award_Details : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void gvwAward_details_RowValidating(object sender, DevExpress.Web.Data.ASPxDataValidationEventArgs e)
    {
        if (e.NewValues["AwardID"] == null)
        {
            AddError(e.Errors, gvwAward_details.Columns["AwardID"], "Award not be null");
        }

        if (e.NewValues["PostingID"] == null)
        {
            AddError(e.Errors, gvwAward_details.Columns["PostingID"], "Posting not be null");
        }   
    }
    private void AddError(Dictionary<GridViewColumn, string> errors, GridViewColumn column, string errorText)
    {
        if (errors.ContainsKey(column)) return;
        errors[column] = errorText;
    }
}